package com.lc.builder;

import java.io.BufferedWriter;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 功能：构建类和属性注释
 * 作者：lc
 * 日期：2024/6/16 22:04
 */
public class BuildComment {
    public static void createClassComment(BufferedWriter bw, String classComment) throws IOException {
        // 获取当前日期和时间
        LocalDateTime currentDateTime = LocalDateTime.now();
        // 格式化日期和时间为字符串
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm");
        String formattedDateTime = currentDateTime.format(formatter);
        bw.write("/**\n" + " * 功能：" + classComment + "\n" + " * 作者：lc\n" + " * 日期：" + formattedDateTime + "\n" + " */\n");
    }

    public static void createFieldComment(BufferedWriter bw, String fieldComment) throws IOException {

        bw.write("\n    /**\n" +
                "     * " + fieldComment + " \n" +
                "     */\n");
    }

    public static void createMethComment() {

    }

}
